tinyMCE.init
({
    mode : "textareas",
    elements : "html",
    theme : "advanced",
    
    theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
    theme_advanced_buttons2 : "cut,copy,paste,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup|,insertdate,inserttime,preview,|,forecolor,backcolor",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_resizing : true,
    width:'506',
    height:'406'
});

function remove_editor(id)
{
    if (tinyMCE.getInstanceById(id))
    {
        $("#source").addClass("on");
        $("#editor").removeClass("on");
        tinyMCE.execCommand('mceFocus', false, id);                    
        tinyMCE.execCommand('mceRemoveControl', false, id);
    }
}
function editor(id)
{       
    $("#source").removeClass("on");
    $("#editor").addClass("on");
     
    tinyMCE.execCommand('mceAddControl', false, id);
    
}
